CURR_DIR=$PWD
cd $HOME/workspace && \
    # libfastcommon
    cd libfastcommon && \
    ./make.sh && \
    sudo ./make.sh install && \
    cd .. && \
    # fastdfs
    cd fastdfs && \
    ./make.sh && \
    sudo ./make.sh install && \
    cd .. && \
    # copy configuration for ngin
    sudo mv /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf && \
    sudo mv /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf && \
    sudo mv ./fastdfs/conf/http.conf /etc/fdfs/ && \
    sudo mv ./fastdfs/conf/mime.types /etc/fdfs/ && \
    cd $CURR_DIR && \
    sudo cp *.service /etc/systemd/system/ && \
    sudo systemctl start fastdfs-tracker.service && \
    sudo systemctl enable fastdfs-tracker.service && \
    sudo systemctl start fastdfs-storage.service && \
    sudo systemctl enable fastdfs-storage.service
    